<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">   

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </h:head>

    <h:body>

        <ui:composition>

            <p:dialog closable="false" showHeader="true" widgetVar="pnAlterarSenhaUsuario" resizable="false" width="320" maximizable="false">

                <f:facet name="header">
                    #{msg.usuarioAlterarSenha}
                </f:facet>

                <h:form id="frm_alterar_senha">

                    <p:messages autoUpdate="true" showDetail="false" escape="false"/>

                    <div align="center">
                        <p:fieldset>
                            <h:panelGrid columns="2" cellspacing="2" cellpadding="2">
                                <p:outputLabel for="itSenhaAtual" value="#{msg.usuarioSenhaAtual}:&nbsp;"/>
                                <p:password id="itSenhaAtual" value="#{alterarSenha.senhaAtual}" style="width: 13em" required="true" requiredMessage="#{msg.usuarioSenhaAtual}: #{msg.campo_obrigatorio}" maxlength="32"/>
                                <p:outputLabel for="itNovaSenha" value="#{msg.usuarioNovaSenha}:&nbsp;"/>
                                <p:password id="itNovaSenha" value="#{alterarSenha.novaSenha}" style="width: 13em" required="true" requiredMessage="#{msg.usuarioNovaSenha}: #{msg.campo_obrigatorio}" maxlength="32"/>
                                <p:outputLabel for="itRepitaSenha" value="#{msg.usuarioRepitaSenha}:"/>
                                <p:password id="itRepitaSenha" value="#{alterarSenha.repitaSenha}" style="width: 13em" required="true" requiredMessage="#{msg.usuarioRepitaSenha}: #{msg.campo_obrigatorio}" maxlength="32"/>
                            </h:panelGrid>                    
                        </p:fieldset>
                    </div>

                    <div class="espacamento"/>

                    <div align="center">
                        <p:commandButton value="#{msg.confirmar}"
                                         action="#{alterarSenha.confirmarAlteracao()}"
                                         icon="ui-icon-check"
                                         process="@form"
                                         update="@form"/>

                        <p:commandButton value="#{msg.fechar}"
                                         icon="ui-icon-close"
                                         immediate="true"
                                         onclick="pnAlterarSenhaUsuario.hide()"/>
                    </div>

                </h:form>

            </p:dialog>

            <ui:include src="/restrito/painel_mensagens.xhtml">
                <ui:param name="tituloPainel" value="#{alterarSenha.tituloPainel}"/>
                <ui:param name="icone" value="#{alterarSenha.tipoMensagem}"/>
                <ui:param name="mensagem" value="#{alterarSenha.mensagem}"/>
            </ui:include>

        </ui:composition>
        
    </h:body>

</html>
